﻿<local:DocumentBase x:Class="WPFExcelReport.YARNREQUEST"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="原料申购"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch" >
    <local:DocumentBase.Resources>
        <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp" IsExpanded="True"
                          Background="White"
                          Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=ARTICLE}" />
                                    <TextBlock Text="{Binding Path=ItemCount}"/>
                                    <TextBlock Text="Items"/>
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource  x:Key="FlickrGroupedFeed" Source="{Binding Path=WBBEW,Source={StaticResource iNTEXDataSet}}">
        </CollectionViewSource>
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <WrapPanel Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" Margin="10,0,0,0"  Name="btnQuery" Width="75" Click="btnQuery_Click" />
            <Button Content="导出申购分析表" Margin="10,0,0,0"   Height="23"   Name="btnPrint" Width="85" Click="btnPrint_Click" />
            <Button Content="导出申购单" Margin="10,0,0,0"   Height="23"   Name="btnReport" Width="75" Click="btnReport_Click" />
        </WrapPanel>
        
        <WrapPanel Grid.Row="2" Width="Auto">
            <fd:FilteringDataGrid               
            AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                                ItemsSource="{Binding}" 
                                            HeadersVisibility="Column"
                                              x:Name="MasterDg" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="883"
                                              Height="500"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                <DataGrid.Columns>
                    <!--GAAUFKRS,GAAUFLFD,GAAUFPOS,TYPE,FABRIC,GAART,GSGARNBEZ,GAFARBE,GSCBEZ,REQWEI-->
                    <DataGridTextColumn Binding="{Binding Path=GAAUFKRS}" Header="前缀" Width="SizeToCells" MinWidth="20" />
                    <DataGridTextColumn Binding="{Binding Path=GAAUFLFD}" Header="订单" Width="SizeToCells" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=GAAUFPOS}" Header="单行" Width="SizeToCells" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=ABPNEUDAT}" Header="日期" Width="SizeToCells" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FACTORY}" Header="加工厂" Width="SizeToCells" MinWidth="100" />
                    <DataGridTextColumn Binding="{Binding Path=TYPE}" Header="类型"  MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=FABRIC}" Header="布号" Width="SizeToCells"  MinWidth="100"/>
                    <DataGridTextColumn Binding="{Binding Path=GAART}" Header="纱线"  MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=GSGARNBEZ}" Header="纱线描述" Width="SizeToHeader" MinWidth="80"/>
                    <DataGridTextColumn Binding="{Binding Path=GAFARBE}" Header="色号" Width="SizeToHeader" MinWidth="50"/>
                    <DataGridTextColumn Binding="{Binding Path=GSCBEZ}" Header="颜色描述" Width="SizeToHeader" MinWidth="100" />
                    <DataGridTextColumn Binding="{Binding Path=REQWEI}" Header="重量"   FontSize="12" Foreground ="Red"  MinWidth="50"/>
                  </DataGrid.Columns>
            </fd:FilteringDataGrid>
        </WrapPanel>
    </Grid>
</local:DocumentBase>
